home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6c 75 | 73 73 2e 69 73 2e 67 65 |Path: lu|ss.is.ge|
|00000010| 2e 63 6f 6d 21 6e 65 77 | 73 0a 46 72 6f 6d 3a 20 |.com!new|s.From: |
|00000020| 77 65 73 74 6c 65 79 20 | 48 65 73 70 65 74 68 20 |westley |Hespeth |
|00000030| 3c 77 65 73 74 6c 65 79 | 40 69 6e 65 74 70 6f 70 |<westley|@inetpop|
|00000040| 2e 69 73 2e 67 65 2e 63 | 6f 6d 3e 0a 4e 65 77 73 |.is.ge.c|om>.News|
|00000050| 67 72 6f 75 70 73 3a 20 | 63 6f 6d 70 2e 6c 61 6e |groups: |comp.lan|
|00000060| 67 2e 63 2b 2b 0a 53 75 | 62 6a 65 63 74 3a 20 52 |g.c++.Su|bject: R|
|00000070| 65 3a 20 2a 2a 2a 4e 65 | 77 62 69 65 20 48 65 6c |e: ***Ne|wbie Hel|
|00000080| 70 20 77 69 74 68 20 61 | 72 72 61 79 73 20 61 6e |p with a|rrays an|
|00000090| 64 20 6c 69 6e 6b 65 72 | 20 65 72 72 6f 72 73 21 |d linker| errors!|
|000000a0| 21 21 2a 2a 2a 0a 44 61 | 74 65 3a 20 57 65 64 2c |!!***.Da|te: Wed,|
|000000b0| 20 32 37 20 4d 61 72 20 | 31 39 39 36 20 31 32 3a | 27 Mar |1996 12:|
|000000c0| 35 35 3a 34 38 20 2d 30 | 35 30 30 0a 4f 72 67 61 |55:48 -0|500.Orga|
|000000d0| 6e 69 7a 61 74 69 6f 6e | 3a 20 47 45 20 49 6e 66 |nization|: GE Inf|
|000000e0| 6f 72 6d 61 74 69 6f 6e | 20 53 65 72 76 69 63 65 |ormation| Service|
|000000f0| 73 2c 20 49 6e 63 2e 0a | 4d 65 73 73 61 67 65 2d |s, Inc..|Message-|
|00000100| 49 44 3a 20 3c 33 31 35 | 39 38 31 32 34 2e 39 34 |ID: <315|98124.94|
|00000110| 31 40 69 6e 65 74 70 6f | 70 2e 69 73 2e 67 65 2e |1@inetpo|p.is.ge.|
|00000120| 63 6f 6d 3e 0a 52 65 66 | 65 72 65 6e 63 65 73 3a |com>.Ref|erences:|
|00000130| 20 3c 33 31 35 30 36 34 | 42 43 2e 32 38 37 43 40 | <315064|BC.287C@|
|00000140| 6d 61 69 6e 65 2e 6d 61 | 69 6e 65 2e 65 64 75 3e |maine.ma|ine.edu>|
|00000150| 0a 4e 4e 54 50 2d 50 6f | 73 74 69 6e 67 2d 48 6f |.NNTP-Po|sting-Ho|
|00000160| 73 74 3a 20 77 68 65 73 | 70 65 74 68 70 63 2e 69 |st: whes|pethpc.i|
|00000170| 73 2e 67 65 2e 63 6f 6d | 0a 4d 69 6d 65 2d 56 65 |s.ge.com|.Mime-Ve|
|00000180| 72 73 69 6f 6e 3a 20 31 | 2e 30 0a 43 6f 6e 74 65 |rsion: 1|.0.Conte|
|00000190| 6e 74 2d 54 79 70 65 3a | 20 74 65 78 74 2f 70 6c |nt-Type:| text/pl|
|000001a0| 61 69 6e 3b 20 63 68 61 | 72 73 65 74 3d 75 73 2d |ain; cha|rset=us-|
|000001b0| 61 73 63 69 69 0a 43 6f | 6e 74 65 6e 74 2d 54 72 |ascii.Co|ntent-Tr|
|000001c0| 61 6e 73 66 65 72 2d 45 | 6e 63 6f 64 69 6e 67 3a |ansfer-E|ncoding:|
|000001d0| 20 37 62 69 74 0a 58 2d | 4d 61 69 6c 65 72 3a 20 | 7bit.X-|Mailer: |
|000001e0| 4d 6f 7a 69 6c 6c 61 20 | 32 2e 30 20 28 57 69 6e |Mozilla |2.0 (Win|
|000001f0| 39 35 3b 20 49 29 0a 54 | 6f 3a 20 61 73 70 65 6e |95; I).T|o: aspen|
|00000200| 63 35 31 20 3c 61 73 70 | 65 6e 63 35 31 40 6d 61 |c51 <asp|enc51@ma|
|00000210| 69 6e 65 2e 6d 61 69 6e | 65 2e 65 64 75 3e 0a 0a |ine.main|e.edu>..|
|00000220| 61 73 70 65 6e 63 35 31 | 20 77 72 6f 74 65 3a 0a |aspenc51| wrote:.|
|00000230| 3e 20 0a 3e 20 49 27 6d | 20 6a 75 73 74 20 73 74 |> .> I'm| just st|
|00000240| 61 72 74 69 6e 67 20 74 | 6f 20 6c 65 61 72 6e 20 |arting t|o learn |
|00000250| 70 72 6f 67 72 61 6d 6d | 69 6e 67 2c 20 61 6e 64 |programm|ing, and|
|00000260| 20 49 27 76 65 20 72 75 | 6e 20 69 6e 74 6f 20 61 | I've ru|n into a|
|00000270| 20 73 6f 72 74 20 6f 66 | 20 62 6c 6f 63 6b 20 77 | sort of| block w|
|00000280| 69 74 68 20 61 72 72 61 | 79 73 2e 20 20 49 27 76 |ith arra|ys. I'v|
|00000290| 65 20 67 6f 74 20 74 68 | 69 73 20 73 69 6d 70 6c |e got th|is simpl|
|000002a0| 65 20 64 69 65 0a 3e 20 | 72 6f 6c 6c 65 72 20 74 |e die.> |roller t|
|000002b0| 68 61 74 20 72 6f 6c 6c | 73 20 34 20 73 69 78 2d |hat roll|s 4 six-|
|000002c0| 73 69 64 65 64 73 20 61 | 6e 64 20 73 75 62 74 72 |sideds a|nd subtr|
|000002d0| 61 63 74 73 20 74 68 65 | 20 6c 6f 77 65 73 74 20 |acts the| lowest |
|000002e0| 6f 66 20 74 68 65 20 34 | 20 66 72 6f 6d 20 74 68 |of the 4| from th|
|000002f0| 65 20 74 6f 74 61 6c 2c | 20 61 6e 64 20 49 20 6a |e total,| and I j|
|00000300| 75 73 74 20 63 61 6e 27 | 74 20 67 65 74 20 69 74 |ust can'|t get it|
|00000310| 20 74 6f 20 77 6f 72 6b | 2e 0a 3e 20 49 27 76 65 | to work|..> I've|
|00000320| 20 6c 6f 6f 6b 65 64 20 | 66 6f 72 20 65 72 72 6f | looked |for erro|
|00000330| 72 73 2c 20 62 75 74 20 | 74 68 65 72 65 20 61 72 |rs, but |there ar|
|00000340| 65 20 6e 6f 20 63 6f 6d | 70 6c 69 65 72 20 70 72 |e no com|plier pr|
|00000350| 6f 62 6c 65 6d 73 20 6d | 79 20 77 72 65 6e 63 68 |oblems m|y wrench|
|00000360| 2d 69 6e 2d 74 68 65 2d | 77 6f 72 6b 73 20 69 73 |-in-the-|works is|
|00000370| 20 61 20 73 69 6e 67 6c | 65 20 6c 69 6e 6b 65 72 | a singl|e linker|
|00000380| 20 65 72 72 6f 72 2e 0a | 3e 20 28 75 6e 64 65 66 | error..|> (undef|
|00000390| 69 6e 65 64 20 73 79 6d | 62 6f 6c 20 27 6d 69 6e |ined sym|bol 'min|
|000003a0| 69 6d 75 6d 28 69 6e 74 | 2c 20 69 6e 74 29 27 20 |imum(int|, int)' |
|000003b0| 69 6e 20 6d 6f 64 75 6c | 65 20 27 64 69 63 65 72 |in modul|e 'dicer|
|000003c0| 6f 6c 6c 2e 63 70 70 27 | 29 20 20 43 61 6e 20 73 |oll.cpp'|) Can s|
|000003d0| 6f 6d 65 6f 6e 65 20 73 | 68 6f 77 20 6d 65 20 77 |omeone s|how me w|
|000003e0| 68 65 72 65 20 74 68 69 | 6e 67 73 20 61 72 65 20 |here thi|ngs are |
|000003f0| 72 75 6e 6e 69 6e 67 20 | 61 6d 75 63 6b 3f 0a 3e |running |amuck?.>|
|00000400| 20 20 54 68 69 73 20 74 | 68 69 6e 67 27 73 20 64 | This t|hing's d|
|00000410| 72 69 76 69 6e 67 20 6d | 65 20 63 72 61 7a 79 21 |riving m|e crazy!|
|00000420| 20 20 4a 75 73 74 20 70 | 6c 65 61 73 65 20 65 2d | Just p|lease e-|
|00000430| 6d 61 69 6c 20 6d 65 20 | 77 69 74 68 20 79 6f 75 |mail me |with you|
|00000440| 72 20 73 75 67 67 65 73 | 74 69 6f 6e 73 20 73 69 |r sugges|tions si|
|00000450| 6e 63 65 20 6d 79 20 6e | 65 77 73 20 73 65 72 76 |nce my n|ews serv|
|00000460| 65 72 20 6b 69 6e 64 20 | 6f 66 20 6f 6e 6c 79 20 |er kind |of only |
|00000470| 68 61 6c 66 0a 3e 20 77 | 6f 72 6b 73 2e 0a 3e 20 |half.> w|orks..> |
|00000480| 0a 3e 20 48 65 72 65 27 | 73 20 74 68 65 20 70 72 |.> Here'|s the pr|
|00000490| 6f 67 72 61 6d 20 28 77 | 72 69 74 74 65 6e 20 75 |ogram (w|ritten u|
|000004a0| 6e 64 65 72 20 42 6f 72 | 6c 61 6e 64 20 34 2e 35 |nder Bor|land 4.5|
|000004b0| 32 20 43 2b 2b 29 0a 3e | 20 0a 3e 20 2f 2a 20 20 |2 C++).>| .> /* |
|000004c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 54 68 69 73 | | This|
|000004d0| 20 69 73 20 61 20 73 69 | 6d 70 6c 65 20 64 69 65 | is a si|mple die|
|000004e0| 20 72 6f 6c 6c 65 72 20 | 70 72 6f 67 72 61 6d 20 | roller |program |
|000004f0| 63 6f 64 65 0a 3e 20 2a | 2a 20 20 72 6f 6c 6c 20 |code.> *|* roll |
|00000500| 69 6e 64 69 76 69 64 75 | 61 6c 20 64 69 63 65 20 |individu|al dice |
|00000510| 61 6e 64 20 74 6f 74 61 | 6c 20 74 68 65 6d 20 6f |and tota|l them o|
|00000520| 72 0a 3e 20 2a 2a 20 20 | 34 64 36 20 2d 20 6c 6f |r.> ** |4d6 - lo|
|00000530| 77 65 73 74 2e 2e 2e 20 | 69 74 20 6b 65 65 70 73 |west... |it keeps|
|00000540| 20 70 6f 70 70 69 6e 67 | 20 75 70 20 77 69 74 68 | popping| up with|
|00000550| 20 61 20 66 61 74 61 6c | 20 6c 69 6e 6b 65 72 20 | a fatal| linker |
|00000560| 65 72 72 6f 72 0a 3e 20 | 2a 2a 20 20 74 68 61 74 |error.> |** that|
|00000570| 20 49 27 6d 20 70 6f 73 | 69 74 69 76 65 20 69 73 | I'm pos|itive is|
|00000580| 20 72 65 6c 61 74 65 64 | 20 74 6f 20 74 68 65 20 | related| to the |
|00000590| 61 72 72 61 79 73 20 6f | 72 0a 3e 20 2a 2a 20 20 |arrays o|r.> ** |
|000005a0| 61 74 20 6c 65 61 73 74 | 20 74 68 65 20 66 75 6e |at least| the fun|
|000005b0| 63 74 69 6f 6e 73 20 63 | 61 6c 6c 69 6e 67 20 61 |ctions c|alling a|
|000005c0| 72 72 61 79 73 2a 2f 0a | 3e 20 0a 3e 20 23 69 6e |rrays*/.|> .> #in|
|000005d0| 63 6c 75 64 65 20 3c 69 | 6f 73 74 72 65 61 6d 2e |clude <i|ostream.|
|000005e0| 68 3e 0a 3e 20 23 69 6e | 63 6c 75 64 65 20 3c 69 |h>.> #in|clude <i|
|000005f0| 6f 6d 61 6e 69 70 2e 68 | 3e 0a 3e 20 23 69 6e 63 |omanip.h|>.> #inc|
|00000600| 6c 75 64 65 20 3c 73 74 | 64 6c 69 62 2e 68 3e 0a |lude <st|dlib.h>.|
|00000610| 3e 20 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 64 69 |> #inclu|de <stdi|
|00000620| 6f 2e 68 3e 0a 3e 20 0a | 3e 20 69 6e 74 20 72 61 |o.h>.> .|> int ra|
|00000630| 6e 64 61 64 64 28 69 6e | 74 2c 20 69 6e 74 29 3b |ndadd(in|t, int);|
|00000640| 0a 3e 20 69 6e 74 20 6d | 69 6e 69 6d 75 6d 28 69 |.> int m|inimum(i|
|00000650| 6e 74 2c 20 69 6e 74 29 | 3b 0a 3e 20 69 6e 74 20 |nt, int)|;.> int |
|00000660| 6d 61 69 6e 28 29 0a 3e | 20 7b 0a 3e 20 20 20 20 |main().>| {.> |
|00000670| 20 20 20 20 20 69 6e 74 | 20 73 69 64 65 73 2c 0a | int| sides,.|
|00000680| 3e 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |> | |
|00000690| 20 20 20 72 6f 6c 6c 73 | 2c 0a 3e 20 20 20 20 20 | rolls|,.> |
|000006a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 76 61 6c | | val|
|000006b0| 75 65 2c 0a 3e 20 20 20 | 20 20 20 20 20 20 20 20 |ue,.> | |
|000006c0| 20 20 20 20 20 20 20 73 | 74 61 72 74 3b 0a 3e 20 | s|tart;.> |
|000006d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000006e0| 20 76 61 6c 75 65 3d 30 | 3b 0a 3e 20 0a 3e 20 20 | value=0|;.> .> |
|000006f0| 20 20 20 20 20 20 20 63 | 6f 75 74 3c 3c 22 52 6f | c|out<<"Ro|
|00000700| 6c 6c 20 66 6f 72 20 43 | 68 61 72 61 63 74 65 72 |ll for C|haracter|
|00000710| 20 6f 72 20 53 69 6e 67 | 6c 65 3f 20 20 31 2c 30 | or Sing|le? 1,0|
|00000720| 22 3b 20 63 69 6e 3e 3e | 73 74 61 72 74 3b 20 63 |"; cin>>|start; c|
|00000730| 6f 75 74 3c 3c 65 6e 64 | 6c 3c 3c 65 6e 64 6c 3b |out<<end|l<<endl;|
|00000740| 20 20 20 20 20 20 20 20 | 20 2f 2f 72 65 61 6c 6c | | //reall|
|00000750| 79 20 73 69 6d 70 6c 65 | 20 6d 65 6e 75 0a 3e 20 |y simple| menu.> |
|00000760| 20 20 20 20 20 20 20 20 | 77 68 69 6c 65 20 28 73 | |while (s|
|00000770| 74 61 72 74 3d 3d 30 29 | 0a 3e 20 20 20 20 20 20 |tart==0)|.> |
|00000780| 20 20 20 20 20 20 20 20 | 20 20 20 7b 0a 3e 20 20 | | {.> |
|00000790| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 63 | | c|
|000007a0| 6f 75 74 3c 3c 22 45 6e | 74 65 72 20 6e 75 6d 62 |out<<"En|ter numb|
|000007b0| 65 72 20 6f 66 20 64 69 | 63 65 20 22 3b 20 63 69 |er of di|ce "; ci|
|000007c0| 6e 3e 3e 72 6f 6c 6c 73 | 3b 20 63 6f 75 74 3c 3c |n>>rolls|; cout<<|
|000007d0| 72 6f 6c 6c 73 3c 3c 22 | 64 22 3c 3c 65 6e 64 6c |rolls<<"|d"<<endl|
|000007e0| 3b 0a 3e 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;.> | |
|000007f0| 20 20 20 20 63 6f 75 74 | 3c 3c 22 20 45 6e 74 65 | cout|<<" Ente|
|00000800| 72 20 6e 75 6d 62 65 72 | 20 6f 66 20 73 69 64 65 |r number| of side|
|00000810| 73 20 22 3b 20 63 69 6e | 3e 3e 73 69 64 65 73 3b |s "; cin|>>sides;|
|00000820| 20 63 6f 75 74 3c 3c 72 | 6f 6c 6c 73 3c 3c 22 64 | cout<<r|olls<<"d|
|00000830| 22 3c 3c 73 69 64 65 73 | 3c 3c 65 6e 64 6c 3b 0a |"<<sides|<<endl;.|
|00000840| 3e 20 0a 3e 20 20 20 20 | 20 20 20 20 20 20 20 20 |> .> | |
|00000850| 20 20 20 20 20 76 61 6c | 75 65 3d 72 61 6e 64 61 | val|ue=randa|
|00000860| 64 64 28 72 6f 6c 6c 73 | 2c 20 73 69 64 65 73 29 |dd(rolls|, sides)|
|00000870| 3b 0a 3e 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;.> | |
|00000880| 20 20 20 20 63 6f 75 74 | 3c 3c 76 61 6c 75 65 3b | cout|<<value;|
|00000890| 0a 3e 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.> | |
|000008a0| 20 20 20 7d 0a 3e 20 20 | 20 20 20 20 20 20 20 77 | }.> | w|
|000008b0| 68 69 6c 65 20 28 73 74 | 61 72 74 3d 3d 2d 31 29 |hile (st|art==-1)|
|000008c0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 6a 75 73 | | //jus|
|000008d0| 74 20 73 74 75 66 66 20 | 74 6f 20 6c 6f 6f 70 20 |t stuff |to loop |
|000008e0| 61 6e 64 20 62 72 65 61 | 6b 0a 3e 20 20 20 20 20 |and brea|k.> |
|000008f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 7b 0a 3e 20 | | {.> |
|00000900| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000910| 72 65 74 75 72 6e 28 30 | 29 3b 0a 3e 20 20 20 20 |return(0|);.> |
|00000920| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 7d 0a 3e | | }.>|
|00000930| 20 20 20 20 20 20 20 20 | 20 77 68 69 6c 65 20 28 | | while (|
|00000940| 73 74 61 72 74 3d 3d 31 | 29 20 20 20 20 20 20 20 |start==1|) |
|00000950| 20 20 20 20 20 2f 2f 63 | 68 61 72 61 63 74 65 72 | //c|haracter|
|00000960| 20 72 6f 6c 6c 65 72 0a | 3e 20 20 20 20 20 20 20 | roller.|> |
|00000970| 20 20 20 20 20 20 20 20 | 20 20 7b 0a 3e 20 20 20 | | {.> |
|00000980| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 69 6e | | in|
|00000990| 74 20 63 6f 75 6e 74 65 | 72 3b 0a 3e 20 20 20 20 |t counte|r;.> |
|000009a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000009b0| 20 20 20 20 20 20 63 6f | 75 6e 74 65 72 3d 36 3b | co|unter=6;|
|000009c0| 0a 3e 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.> | |
|000009d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 77 68 69 6c | | whil|
|000009e0| 65 20 28 63 6f 75 6e 74 | 65 72 20 3e 20 30 29 0a |e (count|er > 0).|
|000009f0| 3e 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |> | |
|00000a00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000a10| 20 20 7b 0a 3e 20 20 20 | 20 20 20 20 20 20 20 20 | {.> | |
|00000a20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000a30| 20 20 20 20 20 20 63 6f | 75 6e 74 65 72 3d 63 6f | co|unter=co|
|00000a40| 75 6e 74 65 72 2d 31 3b | 0a 3e 20 20 20 20 20 20 |unter-1;|.> |
|00000a50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000a60| 20 20 20 20 20 20 20 20 | 20 20 20 69 6e 74 20 72 | | int r|
|00000a70| 6f 6c 6c 31 3d 72 61 6e | 64 61 64 64 28 31 2c 20 |oll1=ran|dadd(1, |
|00000a80| 36 29 2c 0a 3e 20 20 20 | 20 20 20 20 20 20 20 20 |6),.> | |
|00000a90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000aa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 72 | | r|
|00000ab0| 6f 6c 6c 32 3d 72 61 6e | 64 61 64 64 28 31 2c 20 |oll2=ran|dadd(1, |
|00000ac0| 36 29 2c 0a 3e 20 20 20 | 20 20 20 20 20 20 20 20 |6),.> | |
|00000ad0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000ae0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 72 | | r|
|00000af0| 6f 6c 6c 33 3d 72 61 6e | 64 61 64 64 28 31 2c 20 |oll3=ran|dadd(1, |
|00000b00| 36 29 2c 0a 3e 20 20 20 | 20 20 20 20 20 20 20 20 |6),.> | |
|00000b10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000b20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 72 | | r|
|00000b30| 6f 6c 6c 34 3d 72 61 6e | 64 61 64 64 28 31 2c 20 |oll4=ran|dadd(1, |
|00000b40| 36 29 2c 0a 3e 20 20 20 | 20 20 20 20 20 20 20 20 |6),.> | |
|00000b50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000b60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 72 | | r|
|00000b70| 6f 6c 6c 5f 61 72 72 61 | 79 5b 34 5d 3d 7b 72 6f |oll_arra|y[4]={ro|
|00000b80| 6c 6c 31 2c 20 72 6f 6c | 6c 32 2c 20 72 6f 6c 6c |ll1, rol|l2, roll|
|00000b90| 33 2c 20 72 6f 6c 6c 34 | 7d 3b 20 20 2f 2f 34 64 |3, roll4|}; //4d|
|00000ba0| 36 20 2d 20 6c 6f 77 65 | 73 74 0a 3e 20 0a 3e 20 |6 - lowe|st.> .> |
|00000bb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000bc0| 20 20 20 20 20 20 20 20 | 20 76 61 6c 75 65 3d 28 | | value=(|
|00000bd0| 72 6f 6c 6c 31 2b 72 6f | 6c 6c 32 2b 72 6f 6c 6c |roll1+ro|ll2+roll|
|00000be0| 33 2b 72 6f 6c 6c 34 29 | 2d 28 6d 69 6e 69 6d 75 |3+roll4)|-(minimu|
|00000bf0| 6d 28 72 6f 6c 6c 5f 61 | 72 72 61 79 5b 34 5d 20 |m(roll_a|rray[4] |
|00000c00| 2c 20 34 29 29 3b 20 20 | 2f 2f 65 72 72 6f 72 20 |, 4)); |//error |
|00000c10| 0a 73 65 65 6d 73 20 68 | 65 72 65 0a 3e 20 20 20 |.seems h|ere.> |
|00000c20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000c30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000c40| 20 20 20 20 20 20 20 63 | 6f 75 74 3c 3c 76 61 6c | c|out<<val|
|00000c50| 75 65 3c 3c 65 6e 64 6c | 3b 0a 3e 20 20 20 20 20 |ue<<endl|;.> |
|00000c60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000c70| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0a 3e 20 | | }.> |
|00000c80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000c90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000ca0| 63 69 6e 3e 3e 73 74 61 | 72 74 3b 0a 3e 20 20 20 |cin>>sta|rt;.> |
|00000cb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000cc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 69 66 | | if|
|00000cd0| 20 28 73 74 61 72 74 20 | 21 3d 31 29 0a 3e 20 20 | (start |!=1).> |
|00000ce0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000cf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000d00| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 30 3b | r|eturn 0;|
|00000d10| 0a 3e 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.> | |
|00000d20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000d30| 20 20 20 7d 0a 3e 20 7d | 0a 3e 20 0a 3e 20 69 6e | }.> }|.> .> in|
|00000d40| 74 20 72 61 6e 64 61 64 | 64 28 69 6e 74 20 72 6f |t randad|d(int ro|
|00000d50| 6c 6c 73 2c 20 69 6e 74 | 20 73 69 64 65 73 29 20 |lls, int| sides) |
|00000d60| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 72 6f 6c | | //rol|
|00000d70| 6c 69 6e 67 20 66 75 6e | 63 74 69 6f 6e 0a 3e 20 |ling fun|ction.> |
|00000d80| 7b 0a 3e 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |{.> | |
|00000d90| 20 20 20 20 69 6e 74 20 | 61 64 64 3b 0a 3e 20 20 | int |add;.> |
|00000da0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000db0| 20 20 20 20 20 20 20 61 | 64 64 3d 30 3b 0a 3e 20 | a|dd=0;.> |
|00000dc0| 0a 3e 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.> | |
|00000dd0| 20 20 20 77 68 69 6c 65 | 28 72 6f 6c 6c 73 20 3e | while|(rolls >|
|00000de0| 20 30 29 0a 3e 20 20 20 | 20 20 20 20 20 20 20 20 | 0).> | |
|00000df0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 7b 0a | | {.|
|00000e00| 3e 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |> | |
|00000e10| 20 20 20 20 20 20 20 20 | 20 20 72 6f 6c 6c 73 3d | | rolls=|
|00000e20| 28 72 6f 6c 6c 73 2d 31 | 29 3b 0a 3e 20 20 20 20 |(rolls-1|);.> |
|00000e30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000e40| 20 20 20 20 20 61 64 64 | 3d 61 64 64 2b 28 72 61 | add|=add+(ra|
|00000e50| 6e 64 28 29 20 25 20 73 | 69 64 65 73 29 20 2b 31 |nd() % s|ides) +1|
|00000e60| 3b 0a 3e 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;.> | |
|00000e70| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0a 3e 20 | | }.> |
|00000e80| 20 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 | | return |
|00000e90| 61 64 64 3b 0a 3e 20 7d | 0a 3e 20 0a 3e 20 69 6e |add;.> }|.> .> in|
|00000ea0| 74 20 6d 69 6e 69 6d 75 | 6d 28 20 69 6e 74 20 72 |t minimu|m( int r|
|00000eb0| 6f 6c 6c 5f 61 72 72 61 | 79 5b 5d 2c 20 69 6e 74 |oll_arra|y[], int|
|00000ec0| 20 6c 65 6e 67 74 68 29 | 20 20 20 20 20 20 20 20 | length)| |
|00000ed0| 2f 2f 66 69 6e 64 73 20 | 6d 69 6e 69 6d 75 6d 20 |//finds |minimum |
|00000ee0| 76 61 6c 75 65 0a 3e 20 | 7b 0a 3e 20 20 20 20 20 |value.> |{.> |
|00000ef0| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 6e 74 20 | | int |
|00000f00| 6d 69 6e 53 6f 46 61 72 | 3b 0a 3e 20 0a 3e 20 20 |minSoFar|;.> .> |
|00000f10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 69 | | i|
|00000f20| 66 20 28 6c 65 6e 67 74 | 68 3d 3d 31 29 0a 3e 20 |f (lengt|h==1).> |
|00000f30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000f40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000f50| 72 65 74 75 72 6e 20 72 | 6f 6c 6c 5f 61 72 72 61 |return r|oll_arra|
|00000f60| 79 5b 30 5d 3b 0a 3e 20 | 20 20 20 20 20 20 20 20 |y[0];.> | |
|00000f70| 20 20 20 20 20 20 20 20 | 65 6c 73 65 0a 3e 20 20 | |else.> |
|00000f80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000f90| 20 20 20 20 20 20 20 7b | 0a 3e 20 20 20 20 20 20 | {|.> |
|00000fa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000fb0| 20 20 20 6d 69 6e 53 6f | 46 61 72 3d 6d 69 6e 69 | minSo|Far=mini|
|00000fc0| 6d 75 6d 28 72 6f 6c 6c | 5f 61 72 72 61 79 2c 20 |mum(roll|_array, |
|00000fd0| 6c 65 6e 67 74 68 2d 31 | 29 3b 0a 3e 20 20 20 20 |length-1|);.> |
|00000fe0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000ff0| 20 20 20 20 20 69 66 20 | 28 72 6f 6c 6c 5f 61 72 | if |(roll_ar|
|00001000| 72 61 79 5b 6c 65 6e 67 | 74 68 2d 31 5d 3c 6d 69 |ray[leng|th-1]<mi|
|00001010| 6e 53 6f 46 61 72 29 0a | 3e 20 20 20 20 20 20 20 |nSoFar).|> |
|00001020| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001030| 20 20 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e | | return|
|00001040| 20 72 6f 6c 6c 5f 61 72 | 72 61 79 5b 6c 65 6e 67 | roll_ar|ray[leng|
|00001050| 74 68 2d 31 5d 3b 0a 3e | 20 20 20 20 20 20 20 20 |th-1];.>| |
|00001060| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001070| 20 65 6c 73 65 0a 3e 20 | 20 20 20 20 20 20 20 20 | else.> | |
|00001080| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001090| 20 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 20 6d | |return m|
|000010a0| 69 6e 53 6f 46 61 72 3b | 0a 3e 20 20 20 20 20 20 |inSoFar;|.> |
|000010b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000010c0| 20 20 20 7d 0a 3e 20 20 | 7d 0a 0a 48 65 6c 6c 6f | }.> |}..Hello|
|000010d0| 2c 0a 0a 49 6e 20 63 61 | 73 65 20 6e 6f 20 6f 6e |,..In ca|se no on|
|000010e0| 65 20 65 6c 73 65 20 68 | 61 64 20 61 6e 73 77 65 |e else h|ad answe|
|000010f0| 72 65 64 20 70 72 65 76 | 69 69 6f 75 73 6c 79 2e |red prev|iiously.|
|00001100| 20 59 6f 75 72 20 70 72 | 6f 62 6c 65 6d 20 69 73 | Your pr|oblem is|
|00001110| 20 74 68 61 74 20 79 6f | 75 20 0a 70 72 6f 74 6f | that yo|u .proto|
|00001120| 74 79 70 65 64 20 79 6f | 75 72 20 66 75 6e 63 74 |typed yo|ur funct|
|00001130| 69 6f 6e 20 6d 69 6e 69 | 6d 75 6d 20 74 6f 20 61 |ion mini|mum to a|
|00001140| 63 63 65 70 74 20 74 77 | 6f 20 69 6e 74 65 67 65 |ccept tw|o intege|
|00001150| 72 73 2e 20 49 6e 20 79 | 6f 75 72 20 0a 66 6f 6c |rs. In y|our .fol|
|00001160| 6c 6f 77 69 6e 67 20 63 | 6f 64 65 20 79 6f 75 20 |lowing c|ode you |
|00001170| 64 65 66 69 6e 65 64 20 | 6d 69 6e 69 6d 75 6d 20 |defined |minimum |
|00001180| 74 6f 20 61 63 63 65 70 | 74 20 61 20 61 72 72 61 |to accep|t a arra|
|00001190| 79 20 6f 66 20 69 6e 74 | 65 67 65 72 73 20 61 6e |y of int|egers an|
|000011a0| 64 0a 61 6e 20 69 6e 74 | 65 67 65 72 2e 20 54 68 |d.an int|eger. Th|
|000011b0| 65 20 6c 69 6e 6b 65 72 | 20 73 65 65 73 20 74 68 |e linker| sees th|
|000011c0| 69 73 20 61 73 20 74 77 | 6f 20 64 69 66 66 65 72 |is as tw|o differ|
|000011d0| 65 6e 74 20 74 68 69 6e | 67 73 20 79 6f 75 20 77 |ent thin|gs you w|
|000011e0| 61 6e 74 0a 6d 69 6e 20 | 74 6f 20 61 63 63 65 70 |ant.min |to accep|
|000011f0| 74 20 61 6e 20 61 72 72 | 61 79 20 70 72 6f 74 6f |t an arr|ay proto|
|00001200| 74 79 70 65 20 69 74 20 | 61 73 20 73 75 63 68 20 |type it |as such |
|00001210| 69 65 20 6d 69 6e 69 6d | 75 6d 20 28 69 6e 74 20 |ie minim|um (int |
|00001220| 61 72 72 61 79 20 5b 34 | 5d 2c 20 0a 69 6e 74 29 |array [4|], .int)|
|00001230| 20 76 69 63 65 20 6d 69 | 6e 69 6d 75 6d 20 28 69 | vice mi|nimum (i|
|00001240| 6e 74 2c 20 69 6e 74 29 | 2e 20 41 6e 20 61 72 72 |nt, int)|. An arr|
|00001250| 61 79 20 67 65 74 73 20 | 70 61 73 73 65 64 20 61 |ay gets |passed a|
|00001260| 73 20 61 20 70 6f 69 6e | 74 65 72 20 73 6f 20 77 |s a poin|ter so w|
|00001270| 68 65 6e 0a 79 6f 75 20 | 63 61 6c 6c 20 79 6f 75 |hen.you |call you|
|00001280| 72 20 66 75 6e 63 74 69 | 6f 6e 20 28 61 72 72 61 |r functi|on (arra|
|00001290| 79 20 69 73 20 74 68 65 | 20 70 6f 69 6e 74 65 72 |y is the| pointer|
|000012a0| 20 74 6f 20 61 72 72 61 | 79 20 5b 34 5d 29 20 79 | to arra|y [4]) y|
|000012b0| 6f 75 20 77 6f 75 6c 64 | 0a 63 61 6c 6c 20 69 74 |ou would|.call it|
|000012c0| 20 61 73 20 6d 69 6e 69 | 6d 75 6d 20 28 61 72 72 | as mini|mum (arr|
|000012d0| 61 79 2c 20 32 6e 64 20 | 69 6e 74 29 2e 0a 0a 09 |ay, 2nd |int)....|
|000012e0| 09 09 57 65 73 74 6c 65 | 79 20 4c 2e 20 48 65 73 |..Westle|y L. Hes|
|000012f0| 70 65 74 68 0a 09 09 09 | 53 70 65 74 68 20 53 69 |peth....|Speth Si|
|00001300| 66 74 77 61 72 65 2e 0a | 0a 79 6f 75 20 77 72 69 |ftware..|.you wri|
|00001310| 67 68 0a | |gh. | |
+--------+-------------------------+-------------------------+--------+--------+